# -*- coding: utf-8 -*-
from PIL import Image
from PIL import Image

fromImge = Image.open('abc.jpg')
x,y = fromImge.size
mx = y*900/500
toImage = Image.new('RGBA',(mx,y),(246,246,246))
loc = ((mx-x)/2, 0)
print(loc)
toImage.paste(fromImge, loc)

toImage.save('merged.png')

#900*500
